<!DOCTYPE html>
<html>
    <head>
        <?php echo $this->Html->charset(); ?>
        <title><?php echo __('Administrator'); ?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <?php
            $css_array = array(
                'bootstrap/bootstrap.min',
                'bootstrap/bootstrap-responsive.min',
                'admin/font-awesome',
                'admin/style',
            );
            $js_array = array(
                'admin/jquery-1.7.2.min',
                'bootstrap/bootstrap'
            );

            if (Configure::read('debug') > 0):
                echo $this->Html->css($css_array);
                echo $this->fetch('css');

                echo $this->Html->script($js_array);
                echo $this->fetch('script');
            else:
                $this->Combinator->addLibs('css', $css_array);
                $this->Combinator->addLibs('js', $js_array);

                echo $this->Combinator->scripts('css', 'admin');
                echo $this->fetch('css');

                echo $this->Combinator->scripts('js', 'admin');
                echo $this->fetch('script');
            endif;
        ?>
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet">
    </head>
    <body>
        <!--  START navigation bar -->
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="<?php echo Router::url(array('admin' => true, 'controller' => 'admin', 'action' => 'index')); ?>"><?php echo __('Administrator'); ?></a>
                    <div class="nav-collapse">
                        <ul class="nav pull-right">
                            <?php if ($this->Session->read('ADMIN_SESSION')): ?>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="icon-user"></i> <?php echo $this->Session->read('ADMIN_SESSION.firstName'); ?> <?php echo $this->Session->read('ADMIN_SESSION.lastName'); ?><b class="caret"></b>
                                </a>
                                <ul class="dropdown-menu">
                                    <li><a href="<?php echo Router::url(array('admin' => true, 'controller' => 'adminUsers', 'action' => 'edit',$this->Session->read('ADMIN_SESSION.id'))); ?>"><?php echo __('Profile'); ?></a></li>
                                    <li><a href="<?php echo Router::url(array('admin' => true, 'controller' => 'admin', 'action' => 'logout')); ?>"><?php echo __('Logout'); ?></a></li>
                                </ul>
                            </li>
                            <?php else: ?>
                            <!-- not login -->
                            <li class=""></li>
                            <li class="">
                                <a href="/" class="">
                                    <i class="icon-chevron-left"></i>
                                    <?php echo __('Back to Homepage'); ?>
                                </a>
                            </li>
                            <?php endif; ?>
                        </ul>
                    </div>
                    <!--/.nav-collapse -->
                </div>
                <!-- /container -->
            </div>
            <!-- /navbar-inner -->
        </div>
        <?php if ($this->Session->read('ADMIN_SESSION')): ?>
        <div class="subnavbar">
            <div class="subnavbar-inner">
                <div class="container">
                    <ul class="mainnav">
                        <li class="<?php echo ($this->params['controller'] == 'admin')? 'active': ''; ?>"><a href="<?php echo Router::url(array('admin' => true, 'controller' => 'admin', 'action' => 'index')); ?>"><i class="icon-list-alt"></i><span><?php echo __('Dashboard'); ?></span> </a></li>
                        <li class=""><a href=""><i class="icon-list-alt"></i><span><?php echo __('Product'); ?></span> </a></li>
                        <li class=""><a href=""><i class="icon-list-alt"></i><span><?php echo __('Category'); ?></span> </a></li>
                        <li class="<?php echo ($this->params['controller'] == '')? 'active': ''; ?>"><a href=""><i class="icon-list-alt"></i><span><?php echo __('Option'); ?></span> </a></li>
                        <li class="<?php echo ($this->params['controller'] == '')? 'active': ''; ?>"><a href=""><i class="icon-list-alt"></i><span><?php echo __('Content'); ?></span> </a></li>
                        <li class="<?php echo ($this->params['controller'] == '')? 'active': ''; ?>"><a href=""><i class="icon-list-alt"></i><span><?php echo __('About us'); ?></span> </a></li>
                        <li class="<?php echo ($this->params['controller'] == '')? 'active': ''; ?>"><a href=""><i class="icon-list-alt"></i><span><?php echo __('News/Promotion'); ?></span> </a></li>
                        <li class="<?php echo ($this->params['controller'] == '')? 'active': ''; ?>"><a href=""><i class="icon-list-alt"></i><span><?php echo __('Order'); ?></span> </a></li>
                        <li class="<?php echo ($this->params['controller'] == '')? 'active': ''; ?>"><a href=""><i class="icon-list-alt"></i><span><?php echo __('User'); ?></span> </a></li>
                    </ul>
                </div>
                <!-- /container -->
            </div>
            <!-- /subnavbar-inner -->
        </div>
        <?php endif; ?>
        <div class="main">
            <div class="main-inner">
                <div class="container">
                        <?php echo $this->fetch('content'); ?>
                </div>
            </div>
        </div>
        <div class="footer">
            <div class="footer-inner">
                <div class="container">
                    <div class="row">
                        <div class="span12"> &copy; 2014 <a href="http://webrevadep.com">webrevadep.com</a>. </div>
                        <!-- /span12 -->
                    </div>
                    <!-- /row -->
                </div>
                <!-- /container -->
            </div>
            <!-- /footer-inner -->
        </div>
    <?php //echo $his->element('sql_dump'); ?>
    </body>
</html>
